this._isGreeter = false;
this._isActive = false;
this._inUnlockAnimation = false;
+ this._activationTime = 0;
this._lightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true,
this._isModal = true;
}
- if (!this._isActive)
+ if (!this._isActive) {
this._lightbox.show();
+
+ if (this._activationTime == 0)
+ this._activationTime = GLib.get_monotonic_time();
+ }
} else {
let lightboxWasShown = this._lightbox.shown;
this._lightbox.hide();
return this._isActive;
},
+ get activationTime() {
+ return this._activationTime;
+ },
+
_tweenUnlocked: function() {
this._inUnlockAnimation = true;
this.unlock();
if (Main.sessionMode.currentMode == 'unlock-dialog')
Main.sessionMode.popMode('unlock-dialog');
+ this._activationTime = 0;
this._isActive = false;
this.emit('lock-status-changed');
},
this._isModal = true;
}
+ if (this._activationTime == 0)
+ this._activationTime = GLib.get_monotonic_time();
+
this.actor.show();
if (Main.sessionMode.currentMode != 'unlock-dialog' &&
<method name="SetActive">
<arg name="value" direction="in" type="b" />
</method>
+<method name="GetActiveTime">
+ <arg name="value" direction="out" type="u" />
+</method>
<signal name="ActiveChanged">
<arg name="new_value" type="b" />
</signal>
GetActive: function() {
return this._screenShield.locked;
- }
+ },
+
+ GetActiveTime: function() {
+ let started = this._screenShield.activationTime;
+ if (started > 0)
+ return Math.floor((GLib.get_monotonic_time() - started) / 1000000);
+ else
+ return 0;
+ },
});